home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
AIncludes
/
Memory.a
< prev
next >
Wrap
Text File
|
1996-05-01
|
25KB
|
1,325 lines
;
; File: Memory.a
;
; Contains: Memory Manager Interfaces.
;
; Version: Technology: System 7.5
; Release: Universal Interfaces 3.0d3 on Copland DR1
;
; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
;
; Bugs?: If you find a problem with this file, send the file and version
; information (from above) and the problem description to:
;
; Internet: apple.bugs@applelink.apple.com
; AppleLink: APPLE.BUGS
;
;
;
; NOTE
;
; Don't change GetHandleSize and GetPtrSize into inlines. They are documented as returning
; 0 in case of an error in Inside Mac, but the traps actually return an error code in D0.
; The glue sets D0 to 0 if an error occured.
;
IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
__MEMORY__ SET 1
IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
include 'Types.a'
ENDIF
IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
include 'MixedMode.a'
ENDIF
maxSize EQU $00800000 ;Max data block size is 8 megabytes
defaultPhysicalEntryCount EQU 8 ; values returned from the GetPageState function
kPageInMemory EQU 0
kPageOnDisk EQU 1
kNotPaged EQU 2
; masks for Zone->heapType field
k32BitHeap EQU 1 ; valid in all Memory Managers
kNewStyleHeap EQU 2 ; true if new Heap Manager is present
kNewDebugHeap EQU 4 ; true if new Heap Manager is running in debug mode on this heap
; size of a block in bytes
; typedef long Size
IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
Zone RECORD 0
bkLim ds.l 1 ; offset: $0 (0)
purgePtr ds.l 1 ; offset: $4 (4)
hFstFree ds.l 1 ; offset: $8 (8)
zcbFree ds.l 1 ; offset: $C (12)
gzProc ds.l 1 ; offset: $10 (16)
moreMast ds.w 1 ; offset: $14 (20)
flags ds.w 1 ; offset: $16 (22)
cntRel ds.w 1 ; offset: $18 (24)
maxRel ds.w 1 ; offset: $1A (26)
cntNRel ds.w 1 ; offset: $1C (28)
heapType ds.b 1 ; offset: $1E (30) ; previously "maxNRel", now holds flags (e.g. k32BitHeap)
unused ds.b 1 ; offset: $1F (31)
cntEmpty ds.w 1 ; offset: $20 (32)
cntHandles ds.w 1 ; offset: $22 (34)
minCBFree ds.l 1 ; offset: $24 (36)
purgeProc ds.l 1 ; offset: $28 (40)
sparePtr ds.l 1 ; offset: $2C (44)
allocPtr ds.l 1 ; offset: $30 (48)
heapData ds.w 1 ; offset: $34 (52)
sizeof EQU * ; size: $36 (54)
ENDR
; typedef struct Zone * THz
MemoryBlock RECORD 0
address ds.l 1 ; offset: $0 (0)
count ds.l 1 ; offset: $4 (4)
sizeof EQU * ; size: $8 (8)
ENDR
LogicalToPhysicalTable RECORD 0
logical ds MemoryBlock ; offset: $0 (0)
physical ds.b 8 * MemoryBlock.sizeof ; offset: $8 (8)
sizeof EQU * ; size: $48 (72)
ENDR
; typedef short PageState
; typedef short StatusRegisterContents
;
; pascal Ptr GetApplLimit(void)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetApplLimit &dest=(sp)
move.l $0130,&dest
EndM
ELSE
IMPORT_CFM_FUNCTION GetApplLimit
ENDIF
;
; pascal THz SystemZone(void)
;
IF ¨ GENERATINGCFM THEN
Macro
_SystemZone &dest=(sp)
move.l $02A6,&dest
EndM
ELSE
IMPORT_CFM_FUNCTION SystemZone
ENDIF
;
; pascal THz ApplicationZone(void)
;
IF ¨ GENERATINGCFM THEN
Macro
_ApplicationZone &dest=(sp)
move.l $02AA,&dest
EndM
ELSE
IMPORT_CFM_FUNCTION ApplicationZone
ENDIF
;
; pascal Handle GZSaveHnd(void)
;
IF ¨ GENERATINGCFM THEN
Macro
_GZSaveHnd &dest=(sp)
move.l $0328,&dest
EndM
ELSE
IMPORT_CFM_FUNCTION GZSaveHnd
ENDIF
;
; pascal Ptr TopMem(void)
;
IF ¨ GENERATINGCFM THEN
Macro
_TopMem &dest=(sp)
move.l $0108,&dest
EndM
ELSE
IMPORT_CFM_FUNCTION TopMem
ENDIF
;
; pascal OSErr MemError(void)
;
IF ¨ GENERATINGCFM THEN
Macro
_MemError &dest=(sp)
move.w $0220,&dest
EndM
ELSE
IMPORT_CFM_FUNCTION MemError
ENDIF
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
;
; pascal THz GetZone(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; THz <= A0
_GetZone: OPWORD $A11A
ELSE
IMPORT_CFM_FUNCTION GetZone
ENDIF
;
; pascal Handle NewHandle(Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; byteCount => D0
; returns:
; Handle <= A0
_NewHandle: OPWORD $A122
ELSE
IMPORT_CFM_FUNCTION NewHandle
ENDIF
;
; pascal Handle NewHandleSys(Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; byteCount => D0
; returns:
; Handle <= A0
_NewHandleSys: OPWORD $A522
ELSE
IMPORT_CFM_FUNCTION NewHandleSys
ENDIF
;
; pascal Handle NewHandleClear(Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; byteCount => D0
; returns:
; Handle <= A0
_NewHandleClear: OPWORD $A322
ELSE
IMPORT_CFM_FUNCTION NewHandleClear
ENDIF
;
; pascal Handle NewHandleSysClear(Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; byteCount => D0
; returns:
; Handle <= A0
_NewHandleSysClear: OPWORD $A722
ELSE
IMPORT_CFM_FUNCTION NewHandleSysClear
ENDIF
;
; pascal THz HandleZone(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
; returns:
; THz <= A0
_HandleZone: OPWORD $A126
ELSE
IMPORT_CFM_FUNCTION HandleZone
ENDIF
;
; pascal Handle RecoverHandle(Ptr p)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; p => A0
; returns:
; Handle <= A0
_RecoverHandle: OPWORD $A128
ELSE
IMPORT_CFM_FUNCTION RecoverHandle
ENDIF
;
; pascal Handle RecoverHandleSys(Ptr p)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; p => A0
; returns:
; Handle <= A0
_RecoverHandleSys: OPWORD $A528
ELSE
IMPORT_CFM_FUNCTION RecoverHandleSys
ENDIF
;
; pascal Ptr NewPtr(Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; byteCount => D0
; returns:
; Ptr <= A0
_NewPtr: OPWORD $A11E
ELSE
IMPORT_CFM_FUNCTION NewPtr
ENDIF
;
; pascal Ptr NewPtrSys(Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; byteCount => D0
; returns:
; Ptr <= A0
_NewPtrSys: OPWORD $A51E
ELSE
IMPORT_CFM_FUNCTION NewPtrSys
ENDIF
;
; pascal Ptr NewPtrClear(Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; byteCount => D0
; returns:
; Ptr <= A0
_NewPtrClear: OPWORD $A31E
ELSE
IMPORT_CFM_FUNCTION NewPtrClear
ENDIF
;
; pascal Ptr NewPtrSysClear(Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; byteCount => D0
; returns:
; Ptr <= A0
_NewPtrSysClear: OPWORD $A71E
ELSE
IMPORT_CFM_FUNCTION NewPtrSysClear
ENDIF
;
; pascal THz PtrZone(Ptr p)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; p => A0
; returns:
; THz <= A0
_PtrZone: OPWORD $A148
ELSE
IMPORT_CFM_FUNCTION PtrZone
ENDIF
;
; pascal long MaxBlock(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; long <= D0
_MaxBlock: OPWORD $A061
ELSE
IMPORT_CFM_FUNCTION MaxBlock
ENDIF
;
; pascal long MaxBlockSys(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; long <= D0
_MaxBlockSys: OPWORD $A461
ELSE
IMPORT_CFM_FUNCTION MaxBlockSys
ENDIF
;
; pascal long StackSpace(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; long <= D0
_StackSpace: OPWORD $A065
ELSE
IMPORT_CFM_FUNCTION StackSpace
ENDIF
;
; pascal Handle NewEmptyHandle(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; Handle <= A0
_NewEmptyHandle: OPWORD $A166
ELSE
IMPORT_CFM_FUNCTION NewEmptyHandle
ENDIF
;
; pascal Handle NewEmptyHandleSys(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; Handle <= A0
_NewEmptyHandleSys: OPWORD $A566
ELSE
IMPORT_CFM_FUNCTION NewEmptyHandleSys
ENDIF
;
; pascal void HLock(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
_HLock: OPWORD $A029
ELSE
IMPORT_CFM_FUNCTION HLock
ENDIF
;
; pascal void HUnlock(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
_HUnlock: OPWORD $A02A
ELSE
IMPORT_CFM_FUNCTION HUnlock
ENDIF
;
; pascal void HPurge(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
_HPurge: OPWORD $A049
ELSE
IMPORT_CFM_FUNCTION HPurge
ENDIF
;
; pascal void HNoPurge(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
_HNoPurge: OPWORD $A04A
ELSE
IMPORT_CFM_FUNCTION HNoPurge
ENDIF
;
; pascal void HLockHi(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
Macro
_HLockHi
dc.w $A064
dc.w $A029
EndM
ELSE
IMPORT_CFM_FUNCTION HLockHi
ENDIF
;
; pascal Handle TempNewHandle(Size logicalSize, OSErr *resultCode)
;
IF ¨ GENERATINGCFM THEN
Macro
_TempNewHandle
move.w #$001D,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION TempNewHandle
ENDIF
;
; pascal Size TempMaxMem(Size *grow)
;
IF ¨ GENERATINGCFM THEN
Macro
_TempMaxMem
move.w #$0015,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION TempMaxMem
ENDIF
;
; pascal long TempFreeMem(void )
;
IF ¨ GENERATINGCFM THEN
Macro
_TempFreeMem
move.w #$0018,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION TempFreeMem
ENDIF
;
; pascal void InitZone(GrowZoneUPP pgrowZone, short cmoreMasters, void *limitPtr, void *startPtr)
;
IF ¨ GENERATINGCFM THEN
_InitZone: OPWORD $A019
ELSE
IMPORT_CFM_FUNCTION InitZone
ENDIF
;
; pascal void SetZone(THz hz)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; hz => A0
_SetZone: OPWORD $A01B
ELSE
IMPORT_CFM_FUNCTION SetZone
ENDIF
;
; pascal Size CompactMem(Size cbNeeded)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; cbNeeded => D0
; returns:
; Size <= D0
_CompactMem: OPWORD $A04C
ELSE
IMPORT_CFM_FUNCTION CompactMem
ENDIF
;
; pascal Size CompactMemSys(Size cbNeeded)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; cbNeeded => D0
; returns:
; Size <= D0
_CompactMemSys: OPWORD $A44C
ELSE
IMPORT_CFM_FUNCTION CompactMemSys
ENDIF
;
; pascal void PurgeMem(Size cbNeeded)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; cbNeeded => D0
_PurgeMem: OPWORD $A04D
ELSE
IMPORT_CFM_FUNCTION PurgeMem
ENDIF
;
; pascal void PurgeMemSys(Size cbNeeded)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; cbNeeded => D0
_PurgeMemSys: OPWORD $A44D
ELSE
IMPORT_CFM_FUNCTION PurgeMemSys
ENDIF
;
; pascal long FreeMem(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; long <= D0
_FreeMem: OPWORD $A01C
ELSE
IMPORT_CFM_FUNCTION FreeMem
ENDIF
;
; pascal long FreeMemSys(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; long <= D0
_FreeMemSys: OPWORD $A41C
ELSE
IMPORT_CFM_FUNCTION FreeMemSys
ENDIF
;
; pascal void ReserveMem(Size cbNeeded)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; cbNeeded => D0
_ReserveMem: OPWORD $A040
ELSE
IMPORT_CFM_FUNCTION ReserveMem
ENDIF
;
; pascal void ReserveMemSys(Size cbNeeded)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; cbNeeded => D0
_ReserveMemSys: OPWORD $A440
ELSE
IMPORT_CFM_FUNCTION ReserveMemSys
ENDIF
;
; pascal Size MaxMem(Size *grow)
;
IF ¨ GENERATINGCFM THEN
_MaxMem: OPWORD $A11D
ELSE
IMPORT_CFM_FUNCTION MaxMem
ENDIF
;
; pascal Size MaxMemSys(Size *grow)
;
IF ¨ GENERATINGCFM THEN
_MaxMemSys: OPWORD $A51D
ELSE
IMPORT_CFM_FUNCTION MaxMemSys
ENDIF
;
; pascal void SetGrowZone(GrowZoneUPP growZone)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; growZone => A0
_SetGrowZone: OPWORD $A04B
ELSE
IMPORT_CFM_FUNCTION SetGrowZone
ENDIF
;
; pascal void MoveHHi(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
_MoveHHi: OPWORD $A064
ELSE
IMPORT_CFM_FUNCTION MoveHHi
ENDIF
;
; pascal void DisposePtr(Ptr p)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; p => A0
_DisposePtr: OPWORD $A01F
ELSE
IMPORT_CFM_FUNCTION DisposePtr
ENDIF
;
; pascal Size GetPtrSize(Ptr p)
;
IF ¨ GENERATINGCFM THEN
_GetPtrSize: OPWORD $A021
ELSE
IMPORT_CFM_FUNCTION GetPtrSize
ENDIF
;
; pascal void SetPtrSize(Ptr p, Size newSize)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; p => A0
; newSize => D0
_SetPtrSize: OPWORD $A020
ELSE
IMPORT_CFM_FUNCTION SetPtrSize
ENDIF
;
; pascal void DisposeHandle(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
_DisposeHandle: OPWORD $A023
ELSE
IMPORT_CFM_FUNCTION DisposeHandle
ENDIF
;
; pascal void SetHandleSize(Handle h, Size newSize)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
; newSize => D0
_SetHandleSize: OPWORD $A024
ELSE
IMPORT_CFM_FUNCTION SetHandleSize
ENDIF
;
; pascal Size GetHandleSize(Handle h)
;
IF ¨ GENERATINGCFM THEN
_GetHandleSize: OPWORD $A025
ELSE
IMPORT_CFM_FUNCTION GetHandleSize
ENDIF
;
; pascal Size InlineGetHandleSize(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
; returns:
; Size <= D0
_InlineGetHandleSize: OPWORD $A025
ELSE
IMPORT_CFM_FUNCTION InlineGetHandleSize
ENDIF
;
; pascal void ReallocateHandle(Handle h, Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
; byteCount => D0
_ReallocateHandle: OPWORD $A027
ELSE
IMPORT_CFM_FUNCTION ReallocateHandle
ENDIF
;
; pascal void ReallocateHandleSys(Handle h, Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
; byteCount => D0
_ReallocateHandleSys: OPWORD $A427
ELSE
IMPORT_CFM_FUNCTION ReallocateHandleSys
ENDIF
;
; pascal void EmptyHandle(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
_EmptyHandle: OPWORD $A02B
ELSE
IMPORT_CFM_FUNCTION EmptyHandle
ENDIF
;
; pascal void HSetRBit(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
_HSetRBit: OPWORD $A067
ELSE
IMPORT_CFM_FUNCTION HSetRBit
ENDIF
;
; pascal void HClrRBit(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
_HClrRBit: OPWORD $A068
ELSE
IMPORT_CFM_FUNCTION HClrRBit
ENDIF
;
; pascal SInt8 HGetState(Handle h)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
; returns:
; SInt8 <= D0
_HGetState: OPWORD $A069
ELSE
IMPORT_CFM_FUNCTION HGetState
ENDIF
;
; pascal void HSetState(Handle h, SInt8 flags)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; h => A0
; flags => D0
_HSetState: OPWORD $A06A
ELSE
IMPORT_CFM_FUNCTION HSetState
ENDIF
;
; pascal void PurgeSpace(long *total, long *contig)
;
IF ¨ GENERATINGCFM THEN
_PurgeSpace: OPWORD $A162
ELSE
IMPORT_CFM_FUNCTION PurgeSpace
ENDIF
ENDIF
IF FOR_SYSTEM7_ONLY THEN
; These are defined in Kernel for System 8
;
; pascal void BlockMove(const void *srcPtr, void *destPtr, Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; srcPtr => A0
; destPtr => A1
; byteCount => D0
_BlockMove: OPWORD $A02E
ELSE
IMPORT_CFM_FUNCTION BlockMove
ENDIF
;
; pascal void BlockMoveData(const void *srcPtr, void *destPtr, Size byteCount)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; srcPtr => A0
; destPtr => A1
; byteCount => D0
_BlockMoveData: OPWORD $A22E
ELSE
IMPORT_CFM_FUNCTION BlockMoveData
ENDIF
;
; extern void BlockMoveUncached(const void *srcPtr, void *destPtr, Size byteCount)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION BlockMoveUncached
ENDIF
;
; extern void BlockMoveDataUncached(const void *srcPtr, void *destPtr, Size byteCount)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION BlockMoveDataUncached
ENDIF
;
; extern void BlockZero(void *destPtr, Size byteCount)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION BlockZero
ENDIF
;
; extern void BlockZeroUncached(void *destPtr, Size byteCount)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION BlockZeroUncached
ENDIF
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
;
; pascal void MaxApplZone(void )
;
IF ¨ GENERATINGCFM THEN
_MaxApplZone: OPWORD $A063
ELSE
IMPORT_CFM_FUNCTION MaxApplZone
ENDIF
;
; pascal void SetApplBase(void *startPtr)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; startPtr => A0
_SetApplBase: OPWORD $A057
ELSE
IMPORT_CFM_FUNCTION SetApplBase
ENDIF
;
; pascal void MoreMasters(void )
;
IF ¨ GENERATINGCFM THEN
_MoreMasters: OPWORD $A036
ELSE
IMPORT_CFM_FUNCTION MoreMasters
ENDIF
;
; pascal void SetApplLimit(void *zoneLimit)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; zoneLimit => A0
_SetApplLimit: OPWORD $A02D
ELSE
IMPORT_CFM_FUNCTION SetApplLimit
ENDIF
ENDIF
IF FOR_SYSTEM7_ONLY THEN
;
; pascal void InitApplZone(void )
;
IF ¨ GENERATINGCFM THEN
_InitApplZone: OPWORD $A02C
ELSE
IMPORT_CFM_FUNCTION InitApplZone
ENDIF
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
; Temporary Memory routines renamed, but obsolete, in System 7.0 and later.
;
; pascal void TempHLock(Handle h, OSErr *resultCode)
;
IF ¨ GENERATINGCFM THEN
Macro
_TempHLock
move.w #$001E,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION TempHLock
ENDIF
;
; pascal void TempHUnlock(Handle h, OSErr *resultCode)
;
IF ¨ GENERATINGCFM THEN
Macro
_TempHUnlock
move.w #$001F,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION TempHUnlock
ENDIF
;
; pascal void TempDisposeHandle(Handle h, OSErr *resultCode)
;
IF ¨ GENERATINGCFM THEN
Macro
_TempDisposeHandle
move.w #$0020,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION TempDisposeHandle
ENDIF
;
; pascal Ptr TempTopMem(void )
;
IF ¨ GENERATINGCFM THEN
Macro
_TempTopMem
move.w #$0016,-(sp)
dc.w $A88F
EndM
ELSE
IMPORT_CFM_FUNCTION TempTopMem
ENDIF
ENDIF
IF FOR_SYSTEM7_ONLY THEN
;
; pascal OSErr HoldMemory(void *address, unsigned long count)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; address => A0
; count => A1
; returns:
; OSErr <= D0
Macro
_HoldMemory
moveq #0,D0
dc.w $A05C
EndM
ELSE
IMPORT_CFM_FUNCTION HoldMemory
ENDIF
;
; pascal OSErr UnholdMemory(void *address, unsigned long count)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; address => A0
; count => A1
; returns:
; OSErr <= D0
Macro
_UnholdMemory
moveq #1,D0
dc.w $A05C
EndM
ELSE
IMPORT_CFM_FUNCTION UnholdMemory
ENDIF
;
; pascal OSErr LockMemory(void *address, unsigned long count)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; address => A0
; count => A1
; returns:
; OSErr <= D0
Macro
_LockMemory
moveq #2,D0
dc.w $A05C
EndM
ELSE
IMPORT_CFM_FUNCTION LockMemory
ENDIF
;
; pascal OSErr LockMemoryContiguous(void *address, unsigned long count)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; address => A0
; count => A1
; returns:
; OSErr <= D0
Macro
_LockMemoryContiguous
moveq #4,D0
dc.w $A05C
EndM
ELSE
IMPORT_CFM_FUNCTION LockMemoryContiguous
ENDIF
;
; pascal OSErr UnlockMemory(void *address, unsigned long count)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; address => A0
; count => A1
; returns:
; OSErr <= D0
Macro
_UnlockMemory
moveq #3,D0
dc.w $A05C
EndM
ELSE
IMPORT_CFM_FUNCTION UnlockMemory
ENDIF
;
; pascal OSErr GetPhysical(LogicalToPhysicalTable *addresses, unsigned long *physicalEntryCount)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetPhysical
moveq #5,D0
dc.w $A05C
EndM
ELSE
IMPORT_CFM_FUNCTION GetPhysical
ENDIF
;
; pascal OSErr DeferUserFn(UserFnUPP userFunction, void *argument)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; userFunctionargument=> A0
; argument => D0
; returns:
; OSErr <= D0
_DeferUserFn: OPWORD $A08F
ELSE
IMPORT_CFM_FUNCTION DeferUserFn
ENDIF
;
; pascal long DebuggerGetMax(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; long <= D0
Macro
_DebuggerGetMax
moveq #0,D0
dc.w $A08D
EndM
ELSE
IMPORT_CFM_FUNCTION DebuggerGetMax
ENDIF
;
; pascal void DebuggerEnter(void )
;
IF ¨ GENERATINGCFM THEN
Macro
_DebuggerEnter
moveq #1,D0
dc.w $A08D
EndM
ELSE
IMPORT_CFM_FUNCTION DebuggerEnter
ENDIF
;
; pascal void DebuggerExit(void )
;
IF ¨ GENERATINGCFM THEN
Macro
_DebuggerExit
moveq #2,D0
dc.w $A08D
EndM
ELSE
IMPORT_CFM_FUNCTION DebuggerExit
ENDIF
;
; pascal void DebuggerPoll(void )
;
IF ¨ GENERATINGCFM THEN
Macro
_DebuggerPoll
moveq #3,D0
dc.w $A08D
EndM
ELSE
IMPORT_CFM_FUNCTION DebuggerPoll
ENDIF
;
; pascal PageState GetPageState(const void *address)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; address => A0
; returns:
; PageState <= D0
Macro
_GetPageState
moveq #4,D0
dc.w $A08D
EndM
ELSE
IMPORT_CFM_FUNCTION GetPageState
ENDIF
;
; pascal Boolean PageFaultFatal(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; Boolean <= D0
Macro
_PageFaultFatal
moveq #5,D0
dc.w $A08D
EndM
ELSE
IMPORT_CFM_FUNCTION PageFaultFatal
ENDIF
;
; pascal OSErr DebuggerLockMemory(void *address, unsigned long count)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; address => A0
; count => A1
; returns:
; OSErr <= D0
Macro
_DebuggerLockMemory
moveq #6,D0
dc.w $A08D
EndM
ELSE
IMPORT_CFM_FUNCTION DebuggerLockMemory
ENDIF
;
; pascal OSErr DebuggerUnlockMemory(void *address, unsigned long count)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; address => A0
; count => A1
; returns:
; OSErr <= D0
Macro
_DebuggerUnlockMemory
moveq #7,D0
dc.w $A08D
EndM
ELSE
IMPORT_CFM_FUNCTION DebuggerUnlockMemory
ENDIF
;
; pascal StatusRegisterContents EnterSupervisorMode(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; StatusRegisterContents <= D0
Macro
_EnterSupervisorMode
moveq #8,D0
dc.w $A08D
EndM
ELSE
IMPORT_CFM_FUNCTION EnterSupervisorMode
ENDIF
ENDIF
;
; StripAddress and Translate24To32 macro to nothing on PowerPC
; StripAddress is implemented as a trap in System 6 or later
;
;
; pascal Ptr StripAddress(void *theAddress)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; theAddress => D0
; returns:
; Ptr <= D0
_StripAddress: OPWORD $A055
ELSE
IMPORT_CFM_FUNCTION StripAddress
ENDIF
;
; pascal Ptr Translate24To32(void *addr24)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; addr24 => D0
; returns:
; Ptr <= D0
_Translate24To32: OPWORD $A091
ELSE
IMPORT_CFM_FUNCTION Translate24To32
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
;
; pascal OSErr HandToHand(Handle *theHndl)
;
IF ¨ GENERATINGCFM THEN
_HandToHand: OPWORD $A9E1
ELSE
IMPORT_CFM_FUNCTION HandToHand
ENDIF
;
; pascal OSErr PtrToXHand(const void *srcPtr, Handle dstHndl, long size)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; srcPtr => A0
; dstHndl => A1
; size => D0
; returns:
; OSErr <= D0
_PtrToXHand: OPWORD $A9E2
ELSE
IMPORT_CFM_FUNCTION PtrToXHand
ENDIF
;
; pascal OSErr PtrToHand(const void *srcPtr, Handle *dstHndl, long size)
;
IF ¨ GENERATINGCFM THEN
_PtrToHand: OPWORD $A9E3
ELSE
IMPORT_CFM_FUNCTION PtrToHand
ENDIF
;
; pascal OSErr HandAndHand(Handle hand1, Handle hand2)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; hand1 => A0
; hand2 => A1
; returns:
; OSErr <= D0
_HandAndHand: OPWORD $A9E4
ELSE
IMPORT_CFM_FUNCTION HandAndHand
ENDIF
;
; pascal OSErr PtrAndHand(const void *ptr1, Handle hand2, long size)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; ptr1 => A0
; hand2 => A1
; size => D0
; returns:
; OSErr <= D0
_PtrAndHand: OPWORD $A9EF
ELSE
IMPORT_CFM_FUNCTION PtrAndHand
ENDIF
ENDIF
IF OLDROUTINENAMES THEN
IF FOR_SYSTEM7_ONLY THEN
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
ENDIF
ENDIF
ENDIF ; __MEMORY__